package pack0713;

//演示join方法
public class Test3 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1=new MyThread();
        t1.setName("线程1");
        t1.setPriority(1);

        t1.start();

        t1.join();   //需要抛出异常

        for (int i = 0; i < 30; i++) {
            System.out.println(Thread.currentThread().getName()+":"+i+"::"+Thread.currentThread().getId());
        }

        System.out.println(Thread.currentThread().getPriority());
    }
}
